package com.greenyoung.pwiki.elindex.event;

import com.greenyoung.pwiki.common.consts.ConstMq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class ElIndexReceiver {

    private Logger logger = LoggerFactory.getLogger(getClass());

    /**
     * 收到消息队列中的文件id，向数据库发送请求，获取文件url以及文件类型，并根据url进行文件索引
     * @param msg 收到的数据应是个json
     */
    @RabbitListener(queues = ConstMq.ELASTICSEARCH_INDEX_QUEUE)
    public void process(String msg) {
        logger.info("Receiver  : " + msg);
    }

}
